//package org.acme.oauth2.controller;
//
//import org.acme.oauth2.client.Oauth2AuthorizationService;
//import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
//import org.eclipse.microprofile.rest.client.inject.RestClient;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import javax.inject.Inject;
//import javax.ws.rs.*;
//import javax.ws.rs.core.MediaType;
//import javax.ws.rs.core.Response;
//
///**
// * @author LiJian
// * @date 2021/6/21 16:01
// */
//@Path("/oauth")
//@Produces(MediaType.APPLICATION_JSON)
//public class Oauth2AuthorizationController {
//    private static final Logger LOGGER = LoggerFactory.getLogger(Oauth2AuthorizationController.class);
//
//    @Inject
//    @RestClient
//    Oauth2AuthorizationService authorizationService;
//
//    @GET
//    @Path("/token")
//    @ClientHeaderParam(name="Accept",value="application/json")
//    @ClientHeaderParam(name="Authorization",value = "Basic dGRmdWl2dWU6dGRmdWl2dWU=")
//    public Response getCode(@QueryParam("code") String code,
//                            @QueryParam("grant_type") String grant_type,
//                            @QueryParam("redirect_uri") String redirect_uri)
//    {
//        LOGGER.info("****tokenUrl is :****"+code+"**"+grant_type+"**"+redirect_uri);
//
//        String test=authorizationService.getTokenByAuthorization(code, grant_type, redirect_uri).getHeaderString("Authorization");
//
//        LOGGER.info("****tokenUrl is :****"+authorizationService.toString());
//        return Response.ok().build();
//    }
//}
